#pragma once

#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <string>
#include "file_wr.h"
#include "net_wr.h"
using namespace std;
class Socket_tcp{
private:
    int server_fd;
    //char ip_addr[100];
    int port;
    int link_max;
    int new_socket;
    int objcreat_errflag;
    int link_success;
    struct sockaddr_in address;
    File_wr* file_opertion;
public:
    ~Socket_tcp();
    explicit Socket_tcp(const string& str,int l_port,int l_link_max,File_wr* file_opertion);
    int wait_tcp_link();
    int s_read(char* buffer,int len);
    int s_write(char* buffer,int len);
    
};